﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Pavilion.DesignerTool
{
    public class MoveTool : IDrawTool
    {
        public string Name { get { return this.GetType().Name; } }
        public float Size { get; set; }
        public int Opacity { get; set; }

        private Vector2 startingPosition;
        private bool isMoving;

        public void BeginExecution(DrawingBoardData data)
        {
            startingPosition = data.CurrentTexturePositionOnBoard - data.PenPosition;
            isMoving = data.IsPenInsideCurrentTexture;
        }

        public void Execute(DrawingBoardData data)
        {
            if (isMoving)
                data.CurrentTexturePositionOnBoard = data.PenPosition + startingPosition;
        }

        public void EndExecution(DrawingBoardData data, Action creatUndoPointAction)
        {
            Execute(data);

            isMoving = false;
        }

        public void DrawInterface(DrawingBoardData data) { }
    }
}
